#ifndef GLMATERIAL_H
#define GLMATERIAL_H

#include "opengl.h"
#include "texture.h"
#include "Material.h"

namespace rendersystem {

//-------------------------------------------
// Classe Material
//-------------------------------------------
class MyGLMaterial  : public loaders::Material {
    glm::vec3 mKd;
    glm::vec3 mKs;
    float mNs;

    Texture *texture;
    Texture *diffusetexture;
    Texture *speculartexture;
    Texture *shininesstexture;
    Texture *maptexture;

    int hasDiffuse;
    int hasSpecular;
    int hasShininess;
    int hasMap;

public:
    MyGLMaterial(const loaders::Material &mat);
    MyGLMaterial(glm::vec3 kd, glm::vec3 ks, float n) : mKd(kd), mKs(ks), mNs(n), texture(NULL) {
        hasDiffuse=0;
        hasSpecular=0;
        hasShininess=0;
        hasMap=0;

    }

    void getParameters(glm::vec3 &kd, glm::vec3 &ks, float &n) {
        kd = mKd;
        ks = mKs;
        n = mNs;
    }

    void setTexture(Texture *tex);
    void setdiffuseTexture(Texture *tex);
    void setspecularTexture(Texture *tex);
    void setshininessTexture(Texture *tex);
    void setmapTexture(Texture *tex);
    void bindGL(int parameterLocation[9]);
};


}
#endif // GLMATERIAL_H
